// Domain/Repositories/IMenuRepository.cs
using UniversalAdmin.Domain.Entities;

namespace UniversalAdmin.Domain.Repositories;

public interface IMenuRepository : IRepository<Menu>
{
  // 层级菜单查询
  Task<IEnumerable<Menu>> GetHierarchicalMenusAsync();
  Task<IEnumerable<Menu>> GetMenusByParentIdAsync(int? parentId);

  Task<(IEnumerable<Menu> Items, int TotalCount)> GetPagedMenusAsync(
      string? keyword = null,
      bool? isActive = null,
      int pageIndex = 1,
      int pageSize = 10);

  // 角色菜单关联查询
  Task<IEnumerable<Menu>> GetMenusByRoleIdAsync(int roleId);
  Task<IEnumerable<Menu>> GetAccessibleMenusAsync(IEnumerable<int> roleIds);

  // 菜单排序
  Task ReorderMenusAsync(int parentId, IEnumerable<int> orderedMenuIds);


  Task<IEnumerable<Menu>> GetMenusFlatAsync();
}